/*

_normalise.scss

Author: Byron Salau
Contributors:

This file is part of Blanc

Licenced under the MIT License (MIT)
 
Copyright (C) 2011 - 2012 Codagenic Pty. Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/

article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { 
	display: block; 
}
audio, canvas, video { 
	display: inline-block; 
	*display: inline; 
	*zoom: 1; 
}
audio:not([controls]) { 
	display: none; 
}
[hidden] { 
	display: none; 
}


/* =============================================================================
   Base
   ========================================================================== */

/*
 * 1. Correct text resizing oddly in IE6/7 when body font-size is set using em units
 * 2. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g
 */

html { 
	font-size: 100%; 
	-webkit-text-size-adjust: 100%; 
	-ms-text-size-adjust: 100%;
	@include normalizeFont; 
}

body { 
	@include add-margin();
	font-size: rfs(16); 
	line-height: 1.4; 
}

/* =============================================================================
   Links
   ========================================================================== */

a { 
	color: $anchorColor; 
	&:active {
		/* Improve readability when focused and hovered in all browsers: h5bp.com/h */
		outline: 0;
	}
	// &:visited {
	// 	color: $anchorVisitedColor;
	// }
	&:hover {
		color: $anchorHoverColor;
		outline: 0;
	}
	// &:focus {
	// 	outline: thin dotted;
	// }
}

/* =============================================================================
   Typography
   ========================================================================== */

abbr[title] { 
	@include add-border(bottom, 1px, dotted);
}

b, strong { 
	font-weight: bold; 
}

blockquote {
	@include add-margin(all, 1em 40px 1em 40px); 
}

dfn { 
	font-style: italic; 
}

hr { 
	display: block; 
	height: 1px; 
	border: 0; 
	@include add-border(top, 1px, solid, #ccc);
	@include add-margin(all, 1em 0 1em 0); 
	padding: 0; 
}

ins { 
	background: #ff9; 
	color: #000; 
	text-decoration: none; 
}

mark { 
	background: #ff0; 
	color: #000; 
	font: {
		style: italic; 
		weight: bold;
	} 
}

/* Redeclare monospace font family: h5bp.com/j */
pre, code, kbd, samp {
	font: { 
		family: monospace, serif; 
		size: rfs(16);
	} 
	_font-family: 'courier new', monospace; 
}

/* Improve readability of pre-formatted text in all browsers */
pre { 
	white-space: pre; 
	white-space: pre-wrap; 
	word-wrap: break-word; 
}

q { 
	quotes: none; 
	&:before, &:after {
		content: ""; content: none; 
	}
}

small { 
	font-size: 85%; 
}

/* Position subscript and superscript content without affecting line-height: h5bp.com/k */
sub, sup { 
	font-size: rfs(12); 
	line-height: 0; 
	position: relative; 
	vertical-align: baseline; 
}
sup { 
	top: -0.5em; 
}
sub { 
	bottom: -0.25em; 
}


/* =============================================================================
   Lists
   ========================================================================== */

ul, ol { 
	@include add-margin(all, 1em 0 1em 0); 
	padding: 0 0 0 40px; 
}
dd { 
	@include add-margin(all, 0 0 0 40px); 
}
nav {
	ul { 
		@include noListStyle;
	}
	ol {
		@include noListStyle;
	}
}


/* =============================================================================
   Embedded content
   ========================================================================== */

/*
 * 1. Improve image quality when scaled in IE7: h5bp.com/d
 * 2. Remove the gap between images and borders on image containers: h5bp.com/i/440
 */

img { 
	border: 0; 
	-ms-interpolation-mode: bicubic; 
	vertical-align: middle; 
}

/*
 * Correct overflow not hidden in IE9
 */

svg:not(:root) { 
	overflow: hidden; 
}


/* =============================================================================
   Figures
   ========================================================================== */

figure { 
	@include add-margin();
}


/* =============================================================================
   Forms
   ========================================================================== */

form { 
	@include add-margin();
}
fieldset { 
	border: 0; 
	@include add-margin();
	padding: 0; 
}

/*
 * 1. Correct color not inheriting in IE6/7/8/9
 * 2. Correct alignment displayed oddly in IE6/7
 */

legend { 
	border: 0; 
	*margin-left: -7px; 
	padding: 0; 
	white-space: normal; 
}

/*
 * 1. Correct font-size not inheriting in all browsers
 * 2. Remove margins in FF3/4 S5 Chrome
 * 3. Define consistent vertical alignment display in all browsers
 */

select, textarea { 
	@include normalizeFont; 
	font-size: rfs(16); 
	@include add-margin();
	vertical-align: baseline; 
	*vertical-align: middle; 
}

button {
	@include normalizeFont; 
	@include normalizeInput;
	/*
	 * 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet)
	 */
	line-height: normal;
	@include normalizeButton; 
	&[disabled] {
		/*
		 * Re-set default cursor for disabled elements
		 */
		cursor: default; 
	}
	&::-moz-focus-inner {
		border: 0; 
		padding: 0; 
	}
}

input {
	@include normalizeFont; 
	@include normalizeInput;
	/*
	 * 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet)
	 */
	line-height: normal;
	&[type="button"], &[type="reset"], &[type="submit"] {
		@include normalizeButton; 
	}
	&[disabled] {
		/*
		 * Re-set default cursor for disabled elements
		 */
		cursor: default; 
	}
	&[type="checkbox"], &[type="radio"] { 
		/*
		 * Consistent box sizing and appearance
		 */
		box-sizing: border-box; 
		padding: 0; 
		*width: 13px; 
		*height: 13px; 
	}
	&[type="search"] { 
		-webkit-appearance: textfield; 
		-moz-box-sizing: content-box; 
		-webkit-box-sizing: content-box; 
		box-sizing: content-box; 
		&::-webkit-search-decoration, &::-webkit-search-cancel-button { 
			-webkit-appearance: none; 
		}
	}
	&::-moz-focus-inner { 
		/*
		 * Remove inner padding and border in FF3/4: h5bp.com/l
		 */
		border: 0; 
		padding: 0; 
	}
	&:valid {
	}
	&:invalid {
		background-color: $invalidBgColor; 
	}
}


/*
 * 1. Remove default vertical scrollbar in IE6/7/8/9
 * 2. Allow only vertical resizing
 */

textarea { 
	overflow: auto; 
	vertical-align: top; 
	resize: vertical; 
	&:valid { 
	/* Colors for form validity */
	}
	&:invalid { 
		background-color: #f0dddd; 
	}
}

/* =============================================================================
   Tables
   ========================================================================== */

table { 
	border-collapse: collapse; 
	border-spacing: 0; 
}
td { 
	vertical-align: top; 
}


/* =============================================================================
   Chrome Frame Prompt
   ========================================================================== */

.chromeframe { 
	margin: 0.2em 0; 
	background: #ccc; 
	color: black; 
	padding: 0.2em 0; 
}